package com.vapps.planificaciojubilacio;


import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.SeekBar;

public class Orientacio extends Activity {
	private WebView webview;
	private SeekBar seekbar;
	
	
    public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.orientacio);
		
		// Get a reference to the declared WebView holder
        webview = (WebView) this.findViewById(R.id.webview);
        seekbar = (SeekBar) findViewById(R.id.seekbar);
        
        seekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
			@Override
			public void onStopTrackingTouch(SeekBar seekBar) {
			}

			@Override
			public void onStartTrackingTouch(SeekBar seekBar) {
			}

			@Override
			public void onProgressChanged(SeekBar seekBar, int progress,
					boolean fromUser) {
				String value = String.valueOf(progress);
				String mUrl = "http://chart.apis.google.com/chart?chs=250x150&cht=p3&chd=t:32.787," + value + ",100,42.623&chdl=PPI1|PPI2|PPI3|PPA&chtt=";
				webview.loadUrl(mUrl);
			}
		});
        
		// Get the settings
		WebSettings webSettings = webview.getSettings();

		// Enable Javascript for interaction
		webSettings.setJavaScriptEnabled(false);

		// Make the zoom controls visible
		webSettings.setBuiltInZoomControls(false);

		// Allow for touching selecting/deselecting data series
		webview.requestFocusFromTouch();

		// Set the client
		webview.setWebViewClient(new WebViewClient());
		webview.setWebChromeClient(new WebChromeClient());
		
		String mUrl = "http://chart.apis.google.com/chart?chs=250x150&cht=p3&chd=t:32.787,50.82,100,42.623&chdl=PPI1|PPI2|PPI3|PPA&chtt=";
		webview.loadUrl(mUrl);
    }
}
